/**
 * DroperMenuCom - 下拉菜单组件样式
 */

/* 下拉菜单容器 */
.droper-container {
    position: relative;
    display: inline-block;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    color: #333;
}

/* 默认大小 (medium) */
.droper-container-medium {
    font-size: 14px;
}

.droper-trigger-medium {
    padding: 4px 8px;
    min-height: 32px;
}

.droper-menu-item-medium {
    padding: 8px 12px;
}

/* 小尺寸 (small) */
.droper-container-small {
    font-size: 12px;
}

.droper-trigger-small {
    padding: 2px 6px;
    min-height: 24px;
}

.droper-menu-item-small {
    padding: 6px 10px;
}

/* 大尺寸 (large) */
.droper-container-large {
    font-size: 16px;
}

.droper-trigger-large {
    padding: 6px 10px;
    min-height: 36px;
}

.droper-menu-item-large {
    padding: 10px 14px;
}

/* 触发器 */
.droper-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.droper-trigger:hover {
    border-color: var(--theme-color, #409eff);
}

.droper-trigger-active {
    border-color: var(--theme-color, #409eff);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.droper-placeholder {
    flex: 1;
    color: #606266;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.droper-arrow {
    transition: transform 0.3s;
    color: var(--theme-color, #c0c4cc);
    width: 12px;
    height: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.droper-arrow::before {
    content: "";
    display: block;
    width: 8px;
    height: 8px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(135deg);
}

.droper-trigger-active .droper-arrow {
    transform: rotate(180deg);
}

/* 菜单 */
.droper-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 5px;
    background-color: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 200px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.droper-menu-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 菜单项 */
.droper-menu-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    cursor: pointer;
    transition: background-color 0.3s;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.droper-menu-item:hover {
    background-color: #f5f7fa;
}

.droper-menu-item-selected {
    color: var(--theme-color, #409eff);
    font-weight: bold;
}

.droper-menu-item i {
    margin-right: 4px;
    color: #909399;
    flex-shrink: 0; /* 防止图标被压缩 */
}

.droper-item-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0; /* 允许文本区域收缩到0宽度以适应容器 */
}

/* 默认项 */
.droper-default-item {
    color: var(--theme-color, #3b3b3b);
    justify-content: flex-start;
    border-bottom: 1px solid #e4e7ed;
}

.droper-default-item i {
    margin-right: 5px;
}

/* 菜单项操作按钮 */
.droper-item-actions {
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.3s;
    flex-shrink: 0; /* 防止按钮区域被压缩 */
}

.droper-menu-item:hover .droper-item-actions {
    opacity: 1;
}

/* 图标容器 */
.droper-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.3s;
    cursor: pointer;
    position: relative;
    flex-shrink: 0; /* 防止图标容器被压缩 */
}

.droper-menu-item:hover .droper-item-icon {
    opacity: 1;
}

.droper-item-icon svg {
    width: 16px;
    height: 16px;
}

/* 扩大图标悬停检测区域 */
.droper-item-icon::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    background: transparent;
}

/* 悬浮编辑面板 */
.droper-edit-panel {
    position: absolute;
    background-color: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 4px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
    padding: 5px;
    flex-direction: column;
    min-width: 60px; /* 设置最小宽度 */
    box-sizing: border-box;
    max-width: 100%; /* 防止编辑面板超出容器宽度 */
}

.droper-edit-panel.show {
    display: flex;
}

.droper-edit-panel button {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid rgba(0, 0, 0, 0);
    border-radius: 2px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    margin: 0 2px;
    min-width: 50px; /* 设置按钮最小宽度 */
    white-space: nowrap; /* 防止文字换行 */
}

.droper-edit-panel .droper-item-edit-btn:hover {
    color: #409eff;
}

.droper-edit-panel .droper-item-delete-btn:hover {
    color: #409eff;
}

.droper-item-edit-btn,
.droper-item-delete-btn {
    padding: 2px 6px;
    font-size: 12px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 50px; /* 设置按钮最小宽度 */
    white-space: nowrap; /* 防止文字换行 */
}

.droper-item-edit-btn:hover {
    color: #409eff;
}

.droper-item-delete-btn:hover {
    color: #409eff;
}

/* 编辑状态 */
.droper-edit-input {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid #dcdfe6;
    border-radius: 2px;
    font-size: 14px;
    outline: none;
    min-width: 0; /* 允许输入框收缩以适应容器 */
}

.droper-edit-input:focus {
    border-color: var(--theme-color, #409eff);
    box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

.droper-edit-actions {
    display: flex;
    gap: 5px;
    margin-left: 8px;
    flex-shrink: 0; /* 防止操作按钮被压缩 */
}

.droper-edit-confirm,
.droper-edit-cancel {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.droper-edit-confirm {
    background-color: #67c23a;
    color: white;
}

.droper-edit-confirm:hover {
    background-color: #85ce61;
}

.droper-edit-cancel {
    background-color: #f56c6c;
    color: white;
}

.droper-edit-cancel:hover {
    background-color: #f78989;
}

/* 滚动条样式 */
.droper-menu::-webkit-scrollbar {
    width: 6px;
}

.droper-menu::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.droper-menu::-webkit-scrollbar-thumb {
    background: #c0c4cc;
    border-radius: 10px;
}

.droper-menu::-webkit-scrollbar-thumb:hover {
    background: #909399;
}

.floder-plus::before {
    content: url('data:image/svg+xml;charset=utf-8,<svg data-v-58697b5c="" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="currentColor" d="M128 192v640h768V320H485.76L357.504 192zm-32-64h287.872l128.384 128H928a32 32 0 0 1 32 32v576a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V160a32 32 0 0 1 32-32m384 416V416h64v128h128v64H544v128h-64V608H352v-64z"></path></svg>');
    width: 17px;
    height: 17px;
    margin-right: 3px;
    margin-top: 4px;
    display: inline-block;
}

.icon-color {
    width: 15px;
    height: 15px;
    margin-top: 4px;
    margin-right: 4px;
    border: 1px solid #adaeb1;
    border-radius: 5px;
    display: inline-block;
}

.display-none {
    display: none;
}
